package module;

import perso.Groupe;
import perso.MotorPersoImp;
import motor.Motor;
import motor.MotorPerso;
import motor.Unite;

public class ModuleStateImpG extends ModuleStateImp
{
	Groupe gMere;
	
	public ModuleStateImpG(Groupe g, int type )
	{
		this.gMere = g;
		this.type = type;
	}

	public void goOn(MotorPersoImp motorPerso)
	{
		choix();

		action( motorPerso );
	}

	private void action(MotorPersoImp motorPerso)
	{
		switch( getState() )
		{
			case ModuleStateImp.MOVE :
			{
				gMere.prepareMove(motorPerso);
				break;
			}

			case ModuleStateImp.WAIT :
			{
				break;
			}
		}
	}

	private void choix()
	{
		if( type == GROUPE_CIVIL )
		{
			state = ModuleStateImp.MOVE;
		}
		else if( type == GROUPE_STRUCT )
		{
			state = ModuleStateImp.WAIT;
		}
		else if( type == GROUPE_RECOL )
		{
			state = ModuleStateImp.WAIT;
		}
	}

	public Unite getCible()
	{
		return null;
	}

	public void goOn(Motor motor)
	{

	}
}
